﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" src="../JskitLoad.js"></script>

    <script type="text/javascript" src="../JskitConfig.js"></script>

    <link type="text/css" rel="Stylesheet" href="../Reference.css" />
    <title>Crud</title>
</head>
<body>
    <p class="title1">一、在.aspx.cs中使用:</p>
    <textarea cols="" name="JskitSyntax_code" class="cpp">
    using Cn.Edwon.Web.Crud;
    using Cn.Edwon.Web.Support;
    ...
    public partial class MyTest : PageSupport {
        IBiz biz = BizFactory.Get&lt;IUserBiz&gt;();
        protected void Page_Load(object sender, EventArgs e) {
            ...
            Crud.Process(biz);
            ...
        }
    }
    </textarea>
    <div>
    应用Crud必须让页面继承<b>Cn.Edwon.Web.Support.PageSupport</b>
    <br />(CrudOperation)Crud对象可直接使用.
    <br />只需要在页面装载时执行<b>Process</b>方法。
    <br />
    <br />1.Process(IBiz biz);
    <br />biz为实现了Cn.Edwon.Biz.IBiz接口的类。
    <br />
    <br />2.Process(String id,IBiz biz);
    <br />id为crud配置文件中model属性的id，如果设置了该值，则通过这个id查找对应的mode节点。
    <br />其他参数同1
    </div>
    <p>可重载的方法</p>
    <textarea cols="" name="JskitSyntax_code" class="java">
        //在构造创建表单时触发
        public override void OnCrudCreateLoad(object sender, EventArgs e);
        //在构造更新表单时触发
        public override void OnCrudUpdateLoad(object sender, EventArgs e);
        //在构造查看表单时触发
        public override void OnCrudReadLoad(object sender, EventArgs e);
        //在构造Gridview时触发
        public override void OnCrudListLoad(object sender, EventArgs e);
        //在执行查看时触发
        public override void OnCrudRead(object sender, EventArgs e);
        //在执行创建时触发
        public override void OnCrudCreate(object sender, EventArgs e);
        //在执行更新时触发
        public override void OnCrudUpdate(object sender, EventArgs e);
        //在执行删除时触发
        public override void OnCrudDelete(object sender, EventArgs e);
        //在执行搜索时触发
        public override void OnCrudSearch(object sender, EventArgs e);
    </textarea>
    <p class="title1">二、在.aspx文件中加入jskit支持</p>
    <textarea cols="" name="JskitSyntax_code" class="html">
    &lt;head&gt;
        ...
        &lt;script type="text/javascript" src="/jskit.org/JskitLoad.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="/jskit.org/page/JskitTable.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="/jskit.org/server/JskitXmlHttp.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="/jskit.org/model/JskitValidation.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="/jskit.org/model/JskitDateSelector.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="/jskit.org/bulter/JskitBulter.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="/jskit.org/bulter/JskitCrudClient.js"&gt;&lt;/script&gt;
        &lt;!--// 下面两个是缺省的样式定义，可以替换为其他的css文件 --&gt;
        &lt;link type="text/css" rel="Stylesheet" href="/jskit.org/bulter/JskitCrudClient.css" /&gt;
        &lt;link type="text/css" rel="Stylesheet" href="/jskit.org/bulter/JskitDateSelector.css" /&gt;
        ...
    &lt;/head&gt;
    <!-- 必须在body的onload事件中执行jskitBulter的OnLoad方法 -->
    &lt;body onload="jskitBulter.OnLoad()" ...>
    ...
    </textarea>
</body>
</html>
